
module.exports = class {
    constructor() {
        this.$methods = {};
    }
    //无类型说明id
    $set(cbs) {
        if (typeof cbs == 'object') {
            this.$methods = {
                ...this.$methods,
                ...cbs
            }
        }
    }

    $get(id) {
        let cb = this.$methods[id];
        if (typeof cb == 'function') {
            return cb;
        } else if(id!='End'&&id!='Start'){
            console.log('action: ' + id + ' 未定义!')
        }
    }
    $getAll() {
        return this.$methods;
    }
}
